﻿@using Constants = Ideaa.Web.Constants
@model IEnumerable<Ideaa.Web.Models.IdeaModel>

@{
    ViewBag.Title = "Index";
}

<h2>Ideas</h2>

<p>
    @Html.ActionLink("Create New", Constants.Controllers.Idea.Actions.Create)
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Username)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Content)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.DateCreatedOnUtc)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Username)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Content)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateCreatedOnUtc)
        </td>
        <td>
            @Html.ActionLink("Details", Constants.Controllers.Idea.Actions.Details, new { id=item.Id })
        </td>
    </tr>
}

</table>
